<template>
  <view class="split-text-wrapper">
    <textarea v-model="value" class="split-area" :placeholder="placeholder" name="splitText" id="splitText"
      placeholder-class="input-placeholder"></textarea>
    <button class="split-btn" @tap.stop="nextStep">{{ confirmBtnText }}</button>
  </view>
</template>

<script>
export default {
  name: "uni-split-textarea",
  props: {
    placeholder: {
      type: String,
      default: '粘贴信息，自动拆分姓名、电话和地址'
    },
    confirmBtnText: {
      type: String,
      default: '识别'
    }
  },
  data() {
    return {
      value: ''
    }
  },
  methods: {
    nextStep() {
      this.$emit('change', this.value);
    }
  }
}
</script>

<style lang="scss" scoped>
.split-text-wrapper {
  width: 100%;
  position: relative;
  border-radius: 23upx;
  background: #ffffff;
  overflow: hidden;

  .split-area {
    padding: 30upx;
    width: 100%;
    height: 229upx;
    background: #ffffff;
    font-size: 28upx;
    line-height: 39upx;

  }

  .input-placeholder {
    color: #A9A9A9;
  }

  .split-btn {
    padding: 16upx 24upx;
    position: absolute;
    right: 30upx;
    bottom: 30upx;
    z-index: 111;
    text-align: center;
    font-size: 28upx;
    line-height: 39upx;
    background: #30302F;
    border-radius: 100upx;
    color: #ffffff;
  }
}
</style>